
<template>

    <div id="containersss" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

</template>

<script>
import Highcharts from "highcharts";
export default {
    props: ['firstShow'],
    name: '',
    components: {},
    data() {
        return {
            datas: []
        }
    },
    created() {
        // console.log(this.Highcharts)
        console.log(this.suijishu())
        console.log(localStorage.getItem('firstShow'))



        // console.log(this.firstShow)
        // if (this.firstShow == false) {
        //     this.datas = [this.suijishu(), this.suijishu(), this.suijishu()]
        // } else {
        //     this.datas = 
        // }



    },
    mounted() {
        var chart = Highcharts.chart("containersss", {
            credits: {
                enabled: false, // 禁用版权信息
            },
            chart: {
                type: "column",
            },
            title: {
                text: "本期金额",
            },
            subtitle: {
                text: "",
            },
            xAxis: {
                categories: [
                    "2021-12",
                    "2021-11",
                    "2021-10",
                    "2021-9",
                    "2021-8",
                    "2021-7",
                    "2021-6",
                    "2021-5",
                ],
                crosshair: true,
            },
            yAxis: {
                min: 0,
                title: {
                    text: "",
                },
            },
            // tooltip: {
            //     // head + 每个 point + footer 拼接成完整的 table
            //     headerFormat:
            //         '<span style="font-size:10px">{point.key}</span><table>',
            //     pointFormat:
            //         '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
            //         '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
            //     footerFormat: "</table>",
            //     shared: true,
            //     useHTML: true,
            // },
            // plotOptions: {
            //     column: {
            //         borderWidth: 0,
            //     },
            // },
            series: [
                {
                    name: "",
                    // data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5],
                    data: [12955963.88,8310689.6,2391978.01,1623592.57,1199028.41,2391978.01],

                    // data: this.firstShow==true?[this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(),] :[this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(), this.suijishu(),].splice(0,3),
                },
            ],
        });
    },
    methods: {
        suijishu() {
            function getRand(min, max) {
                return parseInt(Math.random() * (max - min + 1) + min);
            }
            return getRand(5000, 100000)
        }


    },

}
</script>
<style scoped lang='scss'>

</style>
